home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 424_02 / ED-157 / set_window.c < prev    next >
C/C++ Source or Header  |  1993-09-10  |  2KB  |  54 lines

  1. /*
  2.  * Copyright (C) 1992 by Rush Record (rhr@clio.rice.edu)
  3.  * 
  4.  * This file is part of ED.
  5.  * 
  6.  * ED is free software; you can redistribute it and/or modify it under the terms
  7.  * of the GNU General Public License as published by the Free Software Foundation.
  8.  * 
  9.  * ED is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  10.  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  11.  * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  12.  * 
  13.  * You should have received a copy of the GNU General Public License along with ED
  14.  * (see the file COPYING).  If not, write to the Free Software Foundation, 675
  15.  * Mass Ave, Cambridge, MA 02139, USA.
  16.  */
  17. #include "opsys.h"
  18.  
  19. #include "rec.h"
  20. #include "window.h"
  21. #include "ed_dec.h"
  22.  
  23. /******************************************************************************\
  24. |Routine: set_window
  25. |Callby: bigger_win edit insert_win remove_win smaller_win wincom
  26. |Purpose: Loads current editing parameters from the window database. Used when
  27. |         switching windows.
  28. |Arguments:
  29. |    n is the number of the window to load from (zero-based).
  30. \******************************************************************************/
  31. void set_window(n)
  32. Int n;
  33. {
  34.     if(n != CURWINDOW)
  35.         unselect();
  36.     BASE = WINDOW[n].base;
  37.     CURREC = WINDOW[n].currec;
  38.     TOPREC = WINDOW[n].toprec;
  39.     BOTREC = WINDOW[n].botrec;
  40.     CURBYT = WINDOW[n].curbyt;
  41.     TOPROW = WINDOW[n].toprow;
  42.     BOTROW = WINDOW[n].botrow;
  43.     TOPLIM = WINDOW[n].toplim;
  44.     BOTLIM = WINDOW[n].botlim;
  45.     CURROW = WINDOW[n].currow;
  46.     CURCOL = WINDOW[n].curcol;
  47.     FIRSTCOL = WINDOW[n].firstcol;
  48.     WANTCOL = WINDOW[n].wantcol;
  49.     HEXMODE = (WINDOW[n].binary == 2);
  50.     CURWINDOW = n;
  51.     marge(TOPROW,BOTROW);
  52. }
  53.  
  54.